package LeetCode.LeetCode2;

/**
 * @author lumin
 * @date 2022/05/07 21:28
 **/
public class Num496 {
    public int[] nextGreaterElement(int[] nums1, int[] nums2) {
        int n1 = nums1.length;
        int n2 = nums2.length;
        int[] arr = new int[Math.min(n1,n2)];
        int i = 0;
        while(i < n1){
            if(nums1[i] >= nums2[i + 1]){
                arr[i] = -1;
            }else{
                arr[i] = nums2[i + 1] - nums1[i];
            }
            i++;
        }
        return arr;
    }
}